package main

import (
	_ "datum_user_rpc/dao"
	"datum_user_rpc/proto"
	"datum_user_rpc/services"
	"github.com/micro/go-micro/v2"
	"github.com/micro/go-micro/v2/registry"
	"github.com/micro/go-plugins/registry/etcdv3/v2"
)

func main()  {
	etcdRegistry := etcdv3.NewRegistry(
		registry.Addrs("47.116.73.130:2379"),
	)
	service := micro.NewService(
		micro.Name("datum_user_rpc"),
		micro.Registry(etcdRegistry),
	)
	service.Init()
	//注册服务
	_ = proto.RegisterUserServiceHandler(service.Server(),new(services.UserService))
	//_ = tokenService.RegisterTokenServiceHandler(service.Server(), new(tokenImp.TokenService))
	_ = service.Run()
}